import Vue from 'vue'
import Router from 'vue-router'
import Home from '../pages/home/home.vue'
Vue.use(Router)
export default new Router({
    routes:[
        {
path:'/',
name:'home',
redirect:'/index',
component:Home,
children:[
    {
        path:'index',
        name:'index',
        component:()=>import('@/pages/home/index.vue')
    },
    {
        path:'product/:id',
        name:'product',
        component:()=>import('@/pages/product/product.vue')
    },
    {
        path:'detail/:id',
        name:'detail',
        component:()=>import('@/pages/detail/detail.vue')
    }
] },
{
    path:'/cart',
    name:'cart',
    component:()=>import('@/pages/cart/cart.vue')
},
{
    path:'/login',
    name:'login',
    component:()=>import('@/pages/login/login.vue')
},
{
    path:'/order',
    name:'order',
    component:()=>import('@/pages/order/order.vue'),
    children:[
        {
            path:'orderList',
            name:'orderList',
            component:()=>import('@/pages/order/order-list/orderList.vue')
        },
        {
            path:'orderConfirm',
            name:'orderConfirm',
            component:()=>import('@/pages/order/order-confirm/orderConfirm.vue')
        },
        {
            path:'orderPay',
            name:'orderPay',
            component:()=>import('@/pages/order/order-pay/orderPay.vue')
        },
        {
            path:'alipay',
            name:'alipay',
            component:()=>import('@/pages/order/alipay/alipay.vue')
        }      
    ]
}
,

    ]
})